<template>
  <div>
    <el-container v-bind:style="{height: clientHeightComputed + 'px', border: '1px solid #eee'}">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <side></side>
      </el-aside>
      <el-main>
        <router-view/>
      </el-main>
    </el-container>
  </div>
</template>
<script>
  import side from '@/components/Side'

  export default {
  name: "Index",
  components: {
    side
  },
  data() {
    const item = {
      date: '2016-05-02',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    };
    return {
      tableData: Array(10).fill(item),
    }
  },
  computed: {
    clientHeightComputed() {
      const clientHeight = this.$store.state.client.clientHeight;
      console.log("clientHeight", clientHeight);
      return clientHeight;
    }
  },
  mounted() {
    const that = this;
    window.onresize = function temp() {
      const number = document.documentElement.clientHeight - 75;
      console.log("number", number)
      that.$store.dispatch('client/setHeight', number)
    }
  },
  methods: {
  }
}
</script>

<style scoped>
</style>